# Maintainer: Ivy Foster <iff@archlinux.org>
# Contributor: alive4ever <alive4ever at live.com>
# Contributor: Earnest
pkgname=opendoas
pkgver=6.8.2
pkgrel=1
pkgdesc='Run commands as super user or another user'
url='https://github.com/Duncaen/OpenDoas'
license=(custom:ISC)
arch=(loong64 x86_64)

depends=(pam)
provides=(doas)
replaces=(doas)

source=(
	"https://github.com/Duncaen/OpenDoas/releases/download/v$pkgver/opendoas-$pkgver.tar.xz"
	"https://github.com/Duncaen/OpenDoas/releases/download/v$pkgver/opendoas-$pkgver.tar.xz.sig"
)
install=opendoas.install

backup=(etc/pam.d/doas)

# checksums provided by packager. Take with a grain of salt!
sha256sums=('4e98828056d6266bd8f2c93e6ecf12a63a71dbfd70a5ea99ccd4ab6d0745adf0'
            'SKIP')
validpgpkeys=(C4B6FBA98211F7EFF35DEB73335C1D17EC3D6E35)

build() {
	cd "opendoas-$pkgver"
	./configure --prefix=/usr --with-timestamp
	make
}

package() {
	cd "opendoas-$pkgver"
	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/opendoas/LICENSE"
}
